﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IDAL;
using Model;

namespace BLL
{
    public class goodsBLL
    {
        private IgoodsDAL goodDAL = DALFactory.DateAccess.GetIgoodsDAL();
        private IordersDAL ordersDAL = DALFactory.DateAccess.GetIordersDAL();
        public IEnumerable<goods> GetGoodsByRandom(int sum)
        {
            return goodDAL.GetGoodsByRandom(sum);
        }
        public IEnumerable<goods> GetGoodsByType(int type, int sum = 10, string name = "undefined", int orderType = 0)
        {
            return goodDAL.GetGoodsByType(type, sum, name, orderType);
        }
        public IEnumerable<goods> GetGoodsByName(string name)
        {
            return goodDAL.GetGoodsByName(name);
        }
        public goods GetGoodsByID(int? id)
        {
            return goodDAL.GetGoodsByID(id);
        }
        public IEnumerable<goods> GetAllGoods()
        {
            return goodDAL.GetAllGoods();
        }
        public void ModifyState(int id)
        {
            goodDAL.ModifyState(id);
        }
        public IEnumerable<goodType> GetTypeList()
        {
            return goodDAL.GetTypeList();
        }
        public void Add(goods good)
        {
            goodDAL.Add(good);
        }
        public void AddGoodsComment(goodComment com)
        {
            goodDAL.AddGoodsComment(com);
        }
        public IEnumerable<orders> GetSendOrder()
        {
            return ordersDAL.GetSendOrder();
        }
    }
}
